package com.thrc.borrow.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.thrc.borrow.dao.CityDao;
import com.thrc.borrow.entity.City;
import com.thrc.borrow.vo.CityVo;

@Service
public class CityService {
	@Autowired
	private CityDao cityDao;

	public List<CityVo> selectAll(City t) {
		return cityDao.selectAll(t);
	}

	public CityVo selectById(City t) {
		return cityDao.selectById(t);
	}

	public List<CityVo> getProvince() {
		City t = new City();
		t.setType(1);
		return cityDao.selectAll(t);
	}

	public void insert(City t) {
		cityDao.insert(t);
	}

	public void update(City t) {
		cityDao.update(t);
	}

	public List<CityVo> getCity(Integer pid) {
		City t = new City();
		t.setPid(pid);
		return cityDao.selectAll(t);
	}

	public int selectCount(City t) {
		return cityDao.selectCount(t);
	}

	public List<CityVo> selectByPage(City t) {
		return cityDao.selectByPage(t);
	}

	public void delete(City t) {
		cityDao.delete(t);
	}
}
